<!--$$$$$$$$$$$$$$$$$$ Mina Adel $$$$$$$$$$$$$$$$$$$ -->
<!--This checks whether the list of stories I receive is nil or not -->

<h2>Feeds</h2>
 <ul class="nav nav-list">
      <li class="divider"></li>
</ul>
<% unless @stories.nil? %>
	<% @stories.each do |f| %>
		<% if f.is_a?(Story) %>
		<div class="story-component-box-mobile">
			<% if f.id.nil? %>
				<% if f.category.nil? %>
					<div class="well" style="border-right:5px solid #f89406;">
				<% else %>
					<% if f.category == "Facebook"%>
						<div class="well" style="border-right:5px solid #3b589a;">
					<% elsif f.category == "twitter"%>
						<div class="well" style="border-right:5px solid #30ccfa;">
					<% elsif f.category == "flickr"%>
						<div class="well" style="border-right:5px solid #fb0080;">
					<% elsif f.category == "tumblr"%>
						<div class="well" style="border-right:5px solid #385672;">
					<% end %>
				<% end %>
				<% serStory = Marshal::dump(f)%>
				<% if f.title.nil? %>
					<h4><%= link_to("Social Feed, No Title", {:controller => 'stories', :action => 'get_story_feed', :serStor => serStory} )%></h4>
						<%if f.media_link!=""%>
						<img src= <%=f.media_link %>>
						<%end%>
							<% if f.category == "Facebook"%>
							<span class="pull-right facebookbadge" >Facebook</span>
							<% elsif f.category == "twitter"%>
								<span class="pull-right twitterbadge">Twitter</span>
							<% elsif f.category == "flickr"%>
								<span class="pull-right flickrbadge">Flickr</span>
							<% elsif f.category == "tumblr"%>
								<span class="pull-right tumblrbadge">Tumblr</span>
								<% end %>
				<% else %>
					<h4><%= link_to(f.title, {:controller => 'stories', :action => 'get_story_feed', :serStor => serStory} )%></h4>
						<%if f.media_link!=""%>
						<img src= <%=f.media_link %>>
						<%end%>
							<% if f.category == "Facebook"%>
							<span class="pull-right facebookbadge">Facebook</span>
							<% elsif f.category == "twitter"%>
								<span class="pull-right twitterbadge">Twitter</span>
							<% elsif f.category == "flickr"%>
								<span class="pull-right flickrbadge">Flickr</span>
							<% elsif f.category == "tumblr"%>
								<span class="pull-right tumblrbadge">Tumblr</span>
					<% end %>
				<% end %>
			<% else %>
			<div id=<%=f.title%> class="well" style="border-right:5px solid #f89406;">
			<% if f.title.nil? %>
				<h3><%= link_to("Interest Feed, No Title", {:controller => 'stories', :action => 'get', :id => f.id} )%></h3>
					<%if f.media_link!=""%>
					<img src= <%=f.media_link %>>
					<%end%>
				<table style="float:right">
					<tr>
						<td><span class="pull-right greenbadge">Ups(<%=f.liked.length%>)</span></td>
						<td><span class="pull-right redbadge">Downs(<%=f.disliked.length%>) </span></td>
					</tr>
				</table>
				<% else %>
				<h4><%= link_to(f.title, {:controller => 'stories', :action => 'get', :id => f.id} )%></h4>
					<%if f.media_link!=""%>
					<img src= <%=f.media_link %>>
					<%end%>
				<table style="float:right">
					<tr>
						<td><span class="pull-right greenbadge">Ups(<%=f.liked.length%>)</span></td>
						<td><span class="pull-right redbadge">Downs(<%=f.disliked.length%>) </span></td>
					</tr>
				</table>
				<% end %>
				</div>
			<% end %>
		</div>
		<% end %>
	<% end %>
	<div class="apple_pagination">
		<%= will_paginate @stories, :container => false %>
	</div>
<% else %>
	<!--if nil, an error message of sorts appears -->
	<div id="Emptiness_Alert" class="story-component-box-mobile">
		There are no stories in your feed.
	</div>
<% end %>
<!--$$$$$$$$$$$$$$$$$$ Mina Adel $$$$$$$$$$$$$$$$$$$ -->
